import Vue from 'vue'
import Router from 'vue-router'
// import {
//   resolve
// } from 'path'
// 系统管理
const formWork = () =>
    import ('./views/orderEdit/workForm/workFormList.vue')
const customField = () =>
    import ('./views/orderEdit/customField/customFieldList.vue')
const makeForm = () =>
    import ('./components/common/makeForm.vue')
const workTrigger = () =>
    import ('./views/orderEdit/workTrigger/workTriggerList')
const createWorkTrigger = () =>
    import ('./views/orderEdit/workTrigger/createWorkTrigger.vue')
const workType = () =>
    import ('./views/orderEdit/workType/WorkTypeList.vue')
const createWorkOrderType = () =>
    import ('./views/orderEdit/workType/CreateWorkOrderType.vue')
    // 工单状态
const workStatus = () =>
    import ('./views/orderEdit/workStatus/workStatusList.vue')
const createStatus = () =>
    import ('./views/orderEdit/workStatus/CreateStatus.vue')
    // 自定义菜单
const customMenu = () =>
    import ('./views/orderEdit/customMenu/customMenu.vue')
    // 编辑工单流程菜单
const orderEditMenu = () =>
    import ('./views/orderEdit/customMenu/orderEditMenu.vue')
    // 新建编辑过滤器自定义菜单
const customEditMenu = () =>
    import ('./views/orderEdit/customMenu/customEditMenu.vue')
    // 新建工单
const createForm = () =>
    import ('./views/orderDataList/createForm.vue')
    // 新建自定义字段
const createCustomField = () =>
    import ('./views/orderEdit/customField/customFileldForm/createCustomField.vue')
    // 我的工单
    // const orderTable = () =>
    //     import ('./views/orderDataList/order.vue')
const orderTable = () =>
    import ('./views/orderDataList/tabLabel.vue')
    // 工单详情
const formDetails = () =>
    import ('./views/orderDataList/formDetails.vue')
    // 客户工单历史
const orderHistory = () =>
    import ('./views/orderInteract/orderHistory.vue')
const customOrder = () =>
    import ('./views/orderInteract/customChild.vue')
    // 查看历史工单
const lookOrder = () =>
    import ('./views/orderInteract/lookOrder.vue')
    // 工单历史数据查询
const orderHisoryData = () =>
    import ('./views/orderDataList/orderHisoryData.vue')
    // 工单历史数据详情页面
const historyInfoDetail = () =>
    import ('./views/orderDataList/historyInfoDetail.vue')
    // 工单数据报表展示
const dataAnalysisShow = () =>
    import ('./views/orderDataShow/dataAnalysisShow.vue')
const orderMonitor = () =>
    import ('./views/orderDataShow/orderMonitor.vue')
    // 其他参数设置
const setParams = () =>
    import ('./views/orderEdit/setParams/setParams.vue')
const customList = () =>
    import ('./views/orderInteract/customList.vue')
    // 通知设置
const setNotice = () =>
    import ('./views/orderEdit/setNotification/setNotice.vue')
    // 通知设置页面
const setNotification = () =>
    import ('./views/orderEdit/setNotification/setNotification.vue')
    // 通知模板维护页面
const noticeTemplateDefend = () =>
    import ('./views/orderEdit/setNotification/noticeTemplateDefend.vue')
    // 新建通知设置页面
const newSetNotice = () =>
    import ('./views/orderEdit/setNotification/newSetNotice.vue')
    // 新建通知模板设置页面
const newSetNoticeTemplate = () =>
    import ('./views/orderEdit/setNotification/newSetNoticeTemplate.vue')
    //     // 新建通知模板设置页面Email
    // const newSetNoticeTemplateEmail = () =>
    //   import ('./views/orderEdit/setNotification/newSetNoticeTemplateEmail.vue')
    //     // 新建通知模板设置页面系统消息
    // const newSetNoticeTemplateMessage = () =>
    //   import ('./views/orderEdit/setNotification/newSetNoticeTemplateMessage.vue')
Vue.use(Router)
export default new Router({
    // mode: 'history',
    routes: [{
            // //   // 首先进行重定向操作
            path: '/',
            redirect: 'orderTable/index',
            //   redirect: {name: 'fm-making-form'}
        },
        {
            path: '/orderTable',
            redirect: 'orderTable/index',
            name: 'orderTable'
        },
        {
            path: '/orderTable/:id',
            component: orderTable,
            name: 'orderTable',
            meta: {
                isUseCache: false, //用于路由跳转时确定页面是否缓存
                keepAlive: true // 是否缓存组件
            }
        },
        {
            path: '/formWork',
            component: formWork
        },
        {
            path: '/customField',
            component: customField
        },
        {
            path: '/makeForm',
            component: makeForm
        },
        {
            path: '/workTrigger',
            component: workTrigger
        },
        {
            path: '/createWorkTrigger',
            component: createWorkTrigger
        },
        {
            path: '/workStatus',
            component: workStatus
        },
        {
            path: '/workType',
            component: workType
        },
        {
            path: '/createWorkOrderType',
            component: createWorkOrderType
        },
        {
            path: '/customMenu',
            component: customMenu
        },
        {
            path: '/orderEditMenu',
            component: orderEditMenu
        },
        {
            path: '/createStatus',
            component: createStatus
        },
        {
            path: '/customEditMenu',
            component: customEditMenu
        },
        {
            path: '/createForm',
            name: 'createForm',
            component: createForm
        },
        {
            path: '/formDetails/:id',
            component: formDetails,
            name: 'formDetails'
        },
        {
            path: '/orderHistory',
            component: orderHistory
        },
        {
            path: '/customOrder',
            component: customOrder
        },
        {
            path: '/lookOrder',
            component: lookOrder
        },
        {
            path: '/orderHisoryData/:id',
            component: orderHisoryData
        },
        {
            path: '/historyInfoDetail',
            component: historyInfoDetail
        },
        {
            path: '/dataAnalysisShow/3',
            component: orderMonitor
        },
        {
            path: '/dataAnalysisShow/:id',
            component: dataAnalysisShow
        },
        {
            path: '/createCustomField',
            component: createCustomField
        },
        {
            path: '/setParams',
            component: setParams
        },
        {
            path: '/customList',
            component: customList
        },
        {
            path: '/setNotice',
            component: setNotice
        },
        {
            path: '/setNotification',
            component: setNotification
        },
        {
            path: '/noticeTemplateDefend',
            component: noticeTemplateDefend
        },
        {
            path: '/newSetNotice',
            component: newSetNotice
        },
        {
            path: '/newSetNoticeTemplate',
            component: newSetNoticeTemplate
        },
        // {
        //     path: '/newSetNoticeTemplateEmail',
        //     component: newSetNoticeTemplateEmail
        // },
        // {
        //     path: '/newSetNoticeTemplateMessage',
        //     component: newSetNoticeTemplateMessage
        // }
    ],
    scrollBehavior(to, from, savedPosition) {
        return {
            x: 0,
            y: 0
        }
    }
})